
#include <stdlib.h>
namespace CERT_EXIT_HANDLER_TERMINATE {

	namespace bad {
		void exit1(void)
		{
			return;
		}

		void exit2(void)
		{
			extern int some_condition;
			if (some_condition) {
				exit(0);
			}
			return;
		}

		int main(void)
		{
			if (atexit(exit1) != 0) {

			}
			if (atexit(exit2) != 0) {

			}
			return 0;
		}
	
	}


	namespace good {
		void exit1(void)
		{
			return;
		}

		void exit2(void)
		{
			extern int some_condition;
			if (some_condition) {
			}
			return;
		}

		int main(void)
		{
			if (atexit(exit1) != 0) {

			}
			if (atexit(exit2) != 0) {
			}
			return 0;
		}

	}

}